import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

fig=plt.figure()
ax=fig.add_subplot(111, projection='3d')
#def data_stream():
#    data = np.zeros((3, 5))
#    xyz = data[:3, :]
#    while True:
#        xyz += 2 * (np.random.random((3, 5)) - 0.5)
#        yield data
#n=100        
#def randrange(n, vmin, vmax):
#    return (vmax-vmin)*np.random.rand(n) + vmin
#xs = randrange(n, 23, 32)
#ys = randrange(n, 0, 100)
##zs = randrange(n, -50, -25)
#data = next(data_stream())
#xCenter,yCenter,zCenter=data
#print xc
#print yc
#print zc
#print xs
#print ys
##print zs
#ax.scatter(xCenter, yCenter, zCenter,c='r',marker='o')


def data_stream():
    data = np.zeros((3, 5))
    xyz = data[:3, :]
    while True:
        xyz += 2 * (np.random.random((3, 5)) - 0.5)
        yield data
data = next(data_stream())
xCenter,yCenter,zCenter=data
print xCenter
print yCenter
print zCenter
ax.scatter(xCenter, yCenter, zCenter,c='r', marker='o')



plt.show()